/**
 * @author casazaft
 */
Package("xclab.mvc.patterns").Class("Singleton", {
        Singleton: function(){
 this.Super.constructor();            var thisClass = this.getClass();
            if (thisClass._instance != null) 
                throw Error("Class " + this.Name + thisClass.SINGLETON_MSG);
            thisClass._instance = this;
        },
        ClassProperties: {
            _instance: null,
            SINGLETON_MSG: ' is Singleton'
        },
        ClassMethods: {
            getInstance: function(){
                if (this._instance == null) 
                    this._instance = new this();
                return this._instance;
            }
        }
    
    
    })
